package com.maiji.cloud.controller.shopingmall;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.maiji.cloud.controller.BaseController;
import com.maiji.cloud.request.shopingmall.AddDownPriceUserLogReqDto;
import com.maiji.cloud.request.shopingmall.DownPriceDetailReqDto;
import com.maiji.cloud.request.shopingmall.DownPriceGoodsReqDto;
import com.maiji.cloud.response.BaseResDto;
import com.maiji.cloud.response.shopingmall.DownPriceDetailResDto;
import com.maiji.cloud.response.shopingmall.DownPriceGoodsListResDto;
import com.maiji.cloud.response.shopingmall.DownPriceUserLogListResDto;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * Description:  
 * @author zhanglr  
 * @date 2019年6月29日
 */
@RestController
@RequestMapping("/downPriceGoodsInterface/")
@Api(tags = {"砍价模块"})
public class DownPriceGoodsController extends BaseController{
	/**
	 * 
	 * @param param
	 * @return
	 */
	@ApiOperation(value = "获得商品砍价免费拿列表")
	@PostMapping("getDownPriceGoodsList")
	public DownPriceGoodsListResDto getDownPriceGoodsList(@RequestBody DownPriceGoodsReqDto param,@RequestHeader("maijiToken") String maijiToken) {
		return postForObjectWithToken(maijiToken,REST_URL_SHOPINGMALL + "/downPriceGoods/getDownPriceGoodsList", param, DownPriceGoodsListResDto.class);
	}
	
	/**
	 * 获取砍价详情
	 * @param param
	 * @return
	 */
	@PostMapping("getDownPriceDetail")
	@ApiOperation(value = "砍价商品详情列表")
	public DownPriceDetailResDto getDownPriceDetail(@RequestBody DownPriceDetailReqDto param,@RequestHeader("maijiToken") String maijiToken){
		
		return postForObjectWithToken(maijiToken,REST_URL_SHOPINGMALL + "/downPriceGoods/getDownPriceDetail", param, DownPriceDetailResDto.class);
	}
	/**
	 * 获取微信用户砍去的价格记录
	 * @param param
	 * @return
	 */
	@PostMapping("getDownPriceUserLogList")
	@ApiOperation(value = "用户砍掉价格列表")
	public DownPriceUserLogListResDto getDownPriceUserLogList(@RequestBody DownPriceDetailReqDto param,@RequestHeader("maijiToken") String maijiToken){
		return postForObjectWithToken(maijiToken,REST_URL_SHOPINGMALL + "/downPriceGoods/getDownPriceUserLogList", param, DownPriceUserLogListResDto.class);
	}
	
	@PostMapping("addDownPriceUserLog")
	@ApiOperation(value = "用户砍价")
	public BaseResDto addDownPriceUserLog(@RequestBody AddDownPriceUserLogReqDto param,@RequestHeader("maijiToken") String maijiToken){
		return postForObjectWithToken(maijiToken,REST_URL_SHOPINGMALL + "/downPriceGoods/addDownPriceUserLog", param, BaseResDto.class);
	}
	
}
